import PrevImg from "./prevImg.vue";

export default {
  install(Vue, options) {
    console.log(options);
    let prevImgConstructor = Vue.extend(PrevImg);
    let instance = new prevImgConstructor(); //组件实例
    document.body.appendChild(instance.$mount().$el);

    let opts = {
      open(opts = { url: "", imgList: [] }) {
        instance.url = opts.url;
        instance.imgList = opts.imgList || [];
        instance.show();
      },
      close() {
        instance.hide();
      },
    };

    Vue.prototype.$PrevImg = opts;
  },
};
